﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="newSession.aspx.cs" Inherits="IndividualTask.WebForm5" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table align="left" border="10" style="width:100%">
     <tr> <td height="50" bgcolor="FFFFCC" align="center"><font size="6" />Сеть кинотеатров</td></tr>
</table>
        <br />
        <br />
        <br />
        <br />
<hr align="left" size="5" color="#F4A460" style="width: 100%"/>

<table border="10" style="width: 100%; height: 400px;">
    <tr>
        <td valign="top" style="width: 20%">
           
            <asp:HyperLink ID="HyperLink2" runat="server" Font-Size="X-Large" 
                NavigateUrl="~/index.aspx">Главная</asp:HyperLink>
            <br />
            <br />
            <asp:HyperLink ID="HyperLink1" runat="server" Font-Size="X-Large" 
                NavigateUrl="~/cinema.aspx">Кинотеатры</asp:HyperLink>
                         <br />
            <br />
            <asp:HyperLink ID="HyperLink3" runat="server" Font-Size="X-Large" 
                NavigateUrl="~/newSession.aspx">Новый сеанс</asp:HyperLink>
           
            <br />
            <br />
            <asp:HyperLink ID="HyperLink5" runat="server" Font-Size="X-Large" 
                NavigateUrl="~/logon.aspx">Вход</asp:HyperLink>
            <br />
            <br />
            <asp:Panel ID="Panel2" runat="server" Height="63px" Visible="False">
                <asp:HyperLink ID="HyperLink4" runat="server" NavigateUrl="~/myAccount.aspx">Мой выбор!</asp:HyperLink>
                <br />
                <asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="Выйти" />
            </asp:Panel>
           
        </td>        
        <td valign="top" style="font-size: large"  >
            





            Добавление нового сеанса<br />
            <br />
            Кинотеатр:<br />
            <asp:ListBox ID="ListBox1" runat="server" AutoPostBack="True" 
                DataSourceID="CinemaSource" DataTextField="Name" DataValueField="id" 
                Height="53px" 
                style="margin-bottom: 0px" Width="161px"></asp:ListBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                ControlToValidate="ListBox1" ErrorMessage="* выберите кинотеатр" 
                Font-Size="Small" ForeColor="Red"></asp:RequiredFieldValidator>
            <br />
            <br />
            Зал:<br />
            <asp:ListBox ID="ListBox2" runat="server" AutoPostBack="True" 
                DataSourceID="hallSource" DataTextField="hallName" DataValueField="hallId" 
                Height="53px" Width="159px"></asp:ListBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                ControlToValidate="ListBox2" ErrorMessage="* выберите зал" Font-Size="Small" 
                ForeColor="Red"></asp:RequiredFieldValidator>
            <br />
            <br />
            Фильм:<br />
            <asp:ListBox ID="ListBox3" runat="server" AutoPostBack="True" 
                DataSourceID="FilmSource" DataTextField="Title" DataValueField="id" 
                Width="161px"></asp:ListBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                ControlToValidate="ListBox3" ErrorMessage="* выберите фильм" Font-Size="Small" 
                ForeColor="Red"></asp:RequiredFieldValidator>
            <br />
            <br />
            Дата:<asp:Calendar ID="Calendar1" runat="server" 
                onselectionchanged="Calendar1_SelectionChanged"></asp:Calendar>
            <asp:TextBox ID="TextBox3" runat="server" ReadOnly="True"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                ControlToValidate="TextBox3" ErrorMessage="* выберите дату" Font-Size="Small" 
                ForeColor="Red"></asp:RequiredFieldValidator>
            <br />
            <br />
            Время:<br />
            <asp:TextBox ID="TextBox1" runat="server">00:00:00</asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                ControlToValidate="TextBox1" Display="Dynamic" 
                ErrorMessage="* введите время сеанса" Font-Size="Small" ForeColor="Red"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                ControlToValidate="TextBox1" 
                ErrorMessage="* формат времени - 24 часовой hh:mm:ss " Font-Size="Small" 
                ForeColor="Red" 
                ValidationExpression="([01]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]" 
                Display="Dynamic"></asp:RegularExpressionValidator>
            <br />
            <br />
            Цена:<br />
            <asp:TextBox ID="TextBox2" runat="server">0</asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                ControlToValidate="TextBox2" Display="Dynamic" ErrorMessage="* введите цену" 
                Font-Size="Small" ForeColor="Red"></asp:RequiredFieldValidator>
            <asp:RangeValidator ID="RangeValidator1" runat="server" 
                ControlToValidate="TextBox2" 
                ErrorMessage="* цена может варьироваться от 100 до 300 р." Font-Size="Small" 
                ForeColor="Red" MaximumValue="300" MinimumValue="100" Display="Dynamic"></asp:RangeValidator>
            <br />
            <br />
            <br />
            <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
                Text="Добавить" />
            <br />
            <br />
            <asp:SqlDataSource ID="FilmSource" runat="server" 
                ConnectionString="<%$ ConnectionStrings:CinemaConnectionString %>" 
                SelectCommand="SELECT [id], [Title] FROM [film]"></asp:SqlDataSource>
            <asp:SqlDataSource ID="hallSource" runat="server" 
                ConnectionString="<%$ ConnectionStrings:CinemaConnectionString %>" 
                SelectCommand="SELECT [hallId], [hallName], [cinemaId] FROM [CinemaAndHall] WHERE ([cinemaId] = @cinemaId)">
                <SelectParameters>
                    <asp:ControlParameter ControlID="ListBox1" Name="cinemaId" 
                        PropertyName="SelectedValue" Type="Int32" />
                </SelectParameters>
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="CinemaSource" runat="server" 
                ConnectionString="<%$ ConnectionStrings:CinemaConnectionString %>" 
                SelectCommand="SELECT [id], [Name] FROM [cinema]"></asp:SqlDataSource>
            





        </td>
    </tr>
</table>
<hr align="left" size="3" color="#F4A460" style="width: 100%"  />
<h5 align="right" title="Авторские права автора"/>&copy;Письма <a href='mailto:demon_alexey@mail.ru' title='мой mail'/>сюда
    </div>
    </form>
</body>
</html>
